<# # It is recommended to test the script on a local machine for its purpose and effects. # ManageEngine Endpoint Central will not be responsible for any # damage/loss to the data/setup based on the behavior of the script. # Description: Script is designed To determine if a webcam is enabled or disabled # Configuration Type - COMPUTER # Note: The script queries the system for devices related to cameras by using the WMI class Win32_PnPEntity, filtering results with the term '%camera%' in the Caption property. # This identifies all camera devices (such as a webcam) that are installed on the system. #> # Get the list of video devices $webcams = Get-WmiObject -Query "SELECT * FROM Win32_PnPEntity WHERE Caption LIKE '%camera%'" # Check if webcams are found if ($webcams) { foreach ($webcam in $webcams) { # Get the status of the webcam device $status = $webcam.Status Write-Host "Webcam: $($webcam.Caption)" Write-Host "Status: $status" # Determine if the webcam is enabled or not if ($status -eq "OK") { Write-Host "The webcam is enabled." } else { Write-Host "The webcam is disabled or not functioning properly." } } } else { Write-Host "No webcam found." }